use super::config::Config;
use anyhow::{Context, Result};
use std::fs;
pub fn load_config() -> Result<Config> {
    let path: &'static str = ".config/Config.toml"; // 配置文件路径
    let content = fs::read_to_string(path).with_context(|| format!("无法读取文件: {}", path))?;
    let config: Config =
        toml::from_str(&content).with_context(|| "TOML 解析失败，请检查格式或字段类型")?;
    Ok(config)
}
